var express = require('express');
const userCtrl = require("../controller/user");
const userValidator = require('../validator/user')
const auth = require('../middleware/auth')
const router = express.Router();

// 用户登录
router.post("/login", userValidator.login, userCtrl.login);

// 用户注册
router.post("/register", userValidator.register, userCtrl.register);

router.post("/token", userCtrl.getToken)

router.get('/list', auth, userCtrl.userList)

router.get('/userInfo', auth, userCtrl.userInfo)

router.post('/delFriend', auth, userCtrl.delFriend)
module.exports = router;
